<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:ui="http://java.sun.com/jsf/facelets" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

<ui:composition>

 <script type="text/javascript">var config = {};</script> 
 
    <ul id="#{idMenu}" class="#{customClass}">
    
      <ui:insert></ui:insert>
    
    </ul>
    
  <script type="text/javascript" src="#{facesContext.externalContext.requestContextPath}/resources/componentes/menu/js/Menu.js"></script>	
 
  <script type="text/javascript">

  <c:if test="#{not empty disabled and disabled eq true}">
  
    $.extend(config,{"disabled":#{disabled}});

  </c:if>
  
  var position = "#{position}";
  
	if($.trim(position) != ""){

		if($.trim(position) == "right bottom"){

			$.extend(config,{"position":{"my":"left top","at":"right top","collision":"none"}});
			
		}
		if($.trim(position) == "right top"){

			$.extend(config,{"position":{"my":"left bottom","at":"right bottom","collision":"none"}});
			
		}
		if($.trim(position) == "left bottom"){

			$.extend(config,{"position":{"my":"right top","at":"left top","collision":"none"}});
			
		}
		if($.trim(position) == "left top"){

			$.extend(config,{"position":{"my":"right bottom","at":"left bottom","collision":"none"}});
			
		}
		if($.trim(position) == "bottom"){

			$.extend(config,{"position":{"my":"left top","at":"left bottom","collision":"none"}});
			
		}
		if($.trim(position) == "top"){

			$.extend(config,{"position":{"my":"left bottom","at":"left top","collision":"none"}});
			
		}

	}

    var icons = "#{icons}";
    
    if($.trim(icons) != ""){

    	$.extend(config,{"icons":{"submenu":icons}});
    	
    }
  
    var menuLib = new Menu();
     
	  menuLib.criarMenu("#"+ "#{idMenu}" , config);

	<c:set var="idMenu" value=""/>
	<c:set var="customClass" value=""/>
	<c:set var="disabled" value=""/>
	<c:set var="position" value=""/>
	<c:set var="icons" value=""/>
	  
  </script>
	  
</ui:composition>
      
</html>